package com.lxy.cloud.user.controller;

import com.lxy.cloud.order.feign.IOrderService;
import com.lxy.cloud.order.feign.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class IndexController {

    @Autowired
    private IOrderService orderService;

    @GetMapping("/hello")
    public String hello() {
        return "user server";
    }

    @RequestMapping("/callOrder")
    public String callOrder() {
        return orderService.hello();
    }

    @RequestMapping("/get")
    public String get() {
        User u = new User();
        u.setName("ttest");
        return orderService.get(u);
    }
}